class_name InventoryUi extends TextureRect

@onready var trash_slot : ItemSlot = $TrashSlot
@onready var tool_slot_container = $ToolSlotContainer
@onready var main_container = $ScrollContainer/MainContainer

@onready var item_slot_scene : PackedScene

var main_inventory : Inventory

var manual_inventory : Inventory

var tool_slot_list : Array[ItemSlot]
var main_slot_list : Array[ItemSlot]
var manual_slot_list : Array[ItemSlot]

func set_main_inventory(inventory : Inventory):
	main_inventory = inventory

func set_manual_inventory(inventory : Inventory):
	manual_inventory = inventory

func _ready() -> void:
	pass

func add_main_slot(item_slot:ItemSlot):
	item_slot.gui_input.connect(func(event):_item_slot_event(event, main_inventory, 7 + len(main_slot_list)))
	main_slot_list.append(item_slot)
	main_container.add_child(item_slot)


#响应槽位事件
func _item_slot_event(event, inventory:Inventory, index:int):
	pass
